
function Q = NURBS(InputsStruct)
    ctrP = InputsStruct.data;
    x = InputsStruct.x;
    knots = InputsStruct.knots;
    k = InputsStruct.k;
    ctrPnums = InputsStruct.ctrPnums;
    w = InputsStruct.w;
    %基函数矩阵
    N = zeros(size(x,2), ctrPnums);
    for i = 1:size(x,2)
        y = zeros(1,ctrPnums);
        for j = 1:ctrPnums
            y(j) = GetBasisFcn(x(i),knots,j-1,k);
        end
        N(i,:) = y;
    end
    Q = ((w .* N) ./ (N * w'))* ctrP;
    Q(size(x,2), :) = ctrP(size(ctrP,1), :);
end